// 商品分类管理路由  /admin/product/baseCategory/xxx
const express = require('express');
const categoryController = require('../../controllers/product/categoryController');
const {authMiddleware} = require('../../middlewares/authMiddleware');
const {apiPathMiddleware} = require('../../middlewares/apiPathMiddleware');
const router = express.Router();

// 获取一级分类列表
router.get('/getCategory1', categoryController.getCategory1);
// 获取二级分类列表
router.get('/getCategory2/:category1Id', categoryController.getCategory2);
// 获取三级分类列表
router.get('/getCategory3/:category2Id', categoryController.getCategory3);
// 获取全部分类列表
router.get('/getCategoryAll', categoryController.getCategoryAll);
// 删除某个分类
router.delete('/removeCategory/:id', authMiddleware, categoryController.removeCategory);
// 添加分类
router.post('/saveCategory', authMiddleware, categoryController.saveCategory);
// 更新某个分类
router.put('/updateCategory', authMiddleware, categoryController.updateCategory);

module.exports = router;
